This article mainly introduces the Strtotime usage of time plus and minus function in PHP, and analyzes the operation skill of date plus and minus operation by combining Strtotime with date function, which can be referenced by friends.
Time plus
Today we see in PHP to calculate the time difference between two times, the following we directly use the Data,strtotime and three functions are implemented, there is a need for friends to refer to.
This is the example that needs to be told today.
PHP Date Time Add minus
/*** Time addition operation* @param int $increment increment* @param string $unit Unit* @param the time format returned by string $returnFormat* @return void*/Public function Add ($increment, $unit = ' s ', $returnFormat =
1. Using the DATE-D optionDate + "%y%m%d"-D "+n days" today's post N day datesDate + "%y%m%d"-D "-N days" today's top N Day dates2. Common date formatPython
[[email protected] tmp] # date + "%F"
--
[[email protected] tmp] # date + "%d"
///
The following code is some of the most commonly used date processing functions, can be two times the date plus and minus, the difference between the two dates, date conversion time cut.
echo Date (' y-m-d ', Strtotime (' +1 d ', strtotime (' 2009-07
In asp,.net, date addition minus is a fairly simple datediff function to calculate how long the difference between two dates is, and when I learn PHP I think so, but completely different from what I think, the following is a friend wrote Php date
PHP has a series of date and time functions, which facilitates you to get time information that you can convert into the format you want and use to calculate or present to your users. But if you want to implement some complex functionality, things
This article mainly introduces the usage examples of the time module and datetime module in Python. it mainly demonstrates the printing and calculation of time and date. For more information, see
Time Module method:
Time. time (): Get the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.